home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 1⁄5⁄90 / 0315-Re Modal Dialogs?-Jan90 < prev    next >
Encoding:
Text File  |  1990-01-05  |  1.9 KB  |  103 lines  |  [TEXT/GEOL]

  1. Item    6054815                         4-Jan-90        10:57
  2.  
  3. From:   KNEPPER                         Knepper, Christopher
  4.  
  5. To:     D4602                           Mass Microsystems, William May,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re-Modal Dialogs?
  10.  
  11. Hi Bill,
  12.  
  13. Here's a 'view' resource description which supports a modal dialog like you're
  14. trying to do, along with some code which manages it. The Return/Enter/Cmd-'.'
  15. keys work as you would expect in a normal modal dialog.
  16.  
  17. Good luck!
  18.  
  19. -Chris
  20.  
  21. resource 'view' (9700, "test", purgeable) {
  22. { root, 'WND!',
  23. { 50, 40 }, { 352, 384 }, sizeFixed, sizeFixed, shown, enabled,
  24. Window {
  25. "TWindow",
  26. dBoxProc,
  27. noGoAwayBox,
  28. notResizable,
  29. modal,
  30. ignoreFirstClick,
  31. freeOnClosing,
  32. disposeOnFree,
  33. doesntCloseDocument,
  34. dontOpenWithDocument,
  35. dontAdaptToScreen,
  36. dontStagger,
  37. dontForceOnScreen,
  38. center,
  39. 'Cnfg',
  40. ""
  41. },
  42. /* [2] */
  43. 'WND!', 'Cnfg',
  44. { 0, 0 },
  45. { 352, 464 }, sizeFixed, sizeFixed, shown, enabled,
  46. DialogView {
  47. "",
  48. 'OK!!',
  49. 'ByBy'
  50. },
  51. /* [3] */
  52. 'Cnfg', 'OK!!',
  53. { 288, 285 },
  54. { 26, 86 }, sizeFixed, sizeFixed, shown, enabled,
  55. Button {
  56. "TButton",
  57. 0b1000000,
  58. {3, 3},
  59. notSizeable,
  60. notDimmed,
  61. notHilited,
  62. dismisses,
  63. {4, 4, 4, 4},
  64. systemFont,
  65. "OK"
  66. },
  67. /* [5] */
  68. 'Cnfg', 'ByBy',
  69. { 320, 286 },
  70. { 20, 80 }, sizeFixed, sizeFixed, shown, enabled,
  71. Button {
  72. "TButton",
  73. 0b0,
  74. {1, 1},
  75. notSizeable,
  76. notDimmed,
  77. notHilited,
  78. dismisses,
  79. noInset,
  80. systemFont,
  81. "Cancel"
  82. },
  83.  
  84. }
  85. };
  86.  
  87. { Hint: Notice that the DialogView is enabled }
  88.  
  89. And now here's some code to manage the modal dialog:
  90.  
  91.     aWindow := NewTemplateWindow(9700, NIL);         { create window }
  92.     FailNIL(aWindow);
  93.     aDialogView := TModulesDlog(aWindow.FindSubView('Cnfg'));
  94.     FailNIL(aDialogView);
  95.     dismisser := aDialogView.PoseModally;               { modal dialog }
  96.     IF (dismisser = 'ByBy') THEN
  97.         {cancel button was clicked}
  98.     ELSE IF (dismisser = 'OK!!') THEN
  99.         {OK button was clicked}
  100.  
  101.  
  102.